package shiwenhui.com.taotao.portal.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import shiwenhui.com.taotao.portal.service.ContentService;

@Controller
public class IndexController {

    @Autowired
    private ContentService contentService;
//    @RequestMapping("/index")
//    public String showIndex(Model model) {
//        return "index";
//    }

    @RequestMapping("/index")
    public String showIndex(Model model) {
        String adJson = contentService.getContentList();
        model.addAttribute("ad1", adJson);
        return "index";
    }

//    @RequestMapping(value = "/httpclient/post",method = RequestMethod.POST,produces = MediaType.TEXT_HTML_VALUE+",charset=utf-8")
//    @ResponseBody
//    public String testPost(String username,String password){
//        String String = "username:"+username+"\tpassword:"+password;
//        System.out.println(String);
//        return  "username:"+username+"password:"+password;
//    }

//    @RequestMapping(value = "/httpclient/post",method = RequestMethod.POST)
//    @ResponseBody
//    public TaotaoResult testPost(String username, String password){
//        System.out.println("username:"+username+"\tpassword:"+password);
//        return  TaotaoResult.ok();
//
//    }
}